<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="/WEB-INF/tags/mooral-html.tld" prefix="mooralHtml" %>


<div class="merchant">
	
	<div class="detail">
		<div class="name"><bean:write name="merchants" property="[0].mname"/></div>
		<div class="description"><img src="<bean:write name="merchants" property="[0].mlogo"/>" /><bean:write name="merchants" property="[0].mdescription"/></div>
	</div>
	
	
	<logic:present name="merchantHaveVouchers">
	
		<div id="paginator">
			<span id="top" class="pagination">
				<mooralHtml:pagination/>
			</span>
		</div>
		
		
		<div id="list">
		    <logic:iterate id="voucher" name="merchants">
		    
		        <mooralHtml:voucher sufix="v"/>
		    
		    </logic:iterate>
		</div>
		
		
		<div id="paginator">
			<span id="bottom" class="pagination">
				<mooralHtml:pagination/>
			</span>
		</div>		
	    
    </logic:present>
</div>



<script>
	$(document).ready( function() {
		return;
		jQuery("#paginator a").click(
			function() {
				//http://localhost:8080/greavings/merchantViewAjax.do?query=merch-1
				//jQuery("#list").load($(this).attr("href") + "Ajax");
				$.get("http://localhost:8080/greavings/merchantViewAjax.do?query=merch-1", function(data) {
					console.log(data);
				});
				$("#list").load("http://localhost:8080/greavings/merchantViewAjax.do?query=merch-1");
				//$(".detail", $("#list")).remove();
				$("#list").remove();
				return false;
			}
		); 
	});
</script>